Repository navigation
feat(e2e): re-submit each country's contract details in the browser - #1479
Merged
Merged
Conversation
The schema canary proves the schema, the SDK form logic and the backend agree, but not that the rendered Onboarding flow does. For each country whose submit check passed, the browser stage now opens the employment in the example app, continues through basic information, renders contract details from the saved values, and re-submits it. It fails when the PATCH is rejected, when Continue is blocked, or when the body differs from what the canary sent. - schema-canary --keep-submitted=<file> keeps those employments and writes country, employment, company and the sent payload to <file>; schema-canary:archive archives them afterwards. - --country takes a comma-separated list. - ack_non_eligible_job_titles is not persisted, so the spec ticks it again on resume. KNOWN_UNSAVED_FIELDS entries (GBR overtime_eligible) must come back empty and are answered again from the sent value. - On PRs, schema-canary:affected runs only the countries whose pinned version, seed or known-unsaved entry changed, and every country when anything else the canary reads changed. Nightly runs every country. - example/src/flows/Onboarding/** now triggers the PR canary: its features and jsfModify change how contract details render. Verified locally: DEU, ESP, FRA and GBR pass in the browser; all 92 countries seed, submit and archive with --keep-submitted. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Contributor
📦 Bundle Size Report
Size Limits
Largest Files (Top 5)
View All Files (291 total)
✅ Bundle size check passed |
Contributor
|
Deploy preview for adp-cost-calculator ready!
Deployed with vercel-action |
Contributor
|
Deploy preview for remote-flows ready!
Deployed with vercel-action |
Contributor
📊 Coverage Report⚪ Coverage unchanged
Detailed BreakdownLines Coverage
Statements Coverage
Functions Coverage
Branches Coverage
✅ Coverage check passed |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit c9b34ee. Configure here.
The first CI run was blocked by the sandbox CloudFront firewall (403 "too much traffic"), which failed the proxy, left Select Country empty and stopped archiving, leaking employments. - The example app's proxy fetched a new OAuth token for every proxied request. It now caches each token until a minute before it expires. - archiveEmployment retries four times with backoff, so a temporary block can't leak employments. - The browser stage runs 3 workers on CI instead of 4. The browser stage also caught the canary drifting from the real form: on rebuild, a default that a condition turns on (ECU forces work_hours_per_week to 40 for full time) was only read from the first build, so the canary never sent it while the form did. The canary now re-reads defaults from the rebuilt fields until they stop changing. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
The kept file was only written at the end of the run, so a timeout or cancel during the canary left kept employments off disk and the always() archive step had nothing to clean up. It's now rewritten after every kept country. Also run the PR canary, and every country, when the affected-countries script changes, and pin upload-artifact's comment to its exact tag. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…anary runs The html and github reporters print nothing until the end, so the browser stage looked stuck. A newer push now cancels the older PR run instead of running both against sandbox at once; the always() archive step still cleans up the cancelled run. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
… job Reuses ci-main's key (runner OS + Playwright version) so the canary shares the cached Chromium, and retries the system-dependency and browser installs instead of failing the run on one apt or download hiccup. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
1 of 2 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Summary
For every EOR country, CI now opens a real sandbox employment in the example app, goes through the onboarding steps up to contract details, and submits again. It fails if the form blocks Continue, the save is rejected, or the browser sends different contract details than were saved.
Why
overtime_eligibleisn't returned after save. That's the Tiger bug in partner-facing terms.What changed
Toggle details
Per country (
example/e2e/canary/contract-details.spec.ts, own configexample/playwright.canary.config.ts, excluded from the regular e2e run):--keep-submitted=<file>it keeps the employments whose submit passed and writes country, employment, company and the sent payload.?demo=onboarding-basic&employmentId=…, continues through select country, basic information and engagement agreement where a country has it.PATCH /v1/employments/{id}. It must return 2xx, itscontract_detailsmust equal what the canary sent, and the next step must show.npm run schema-canary:archive -- --from=<file>archives everything, in analways()step.Exceptions, both explicit:
ack_non_eligible_job_titlesisn't persisted, so the spec ticks it again on resume. That's the only checkbox it touches.KNOWN_UNSAVED_FIELDSentries (GBRovertime_eligible) must come back empty, which asserts the bug is still there, and are answered again from the sent value. Once Tiger fixes it, the spec fails and says to remove the entry.Which countries run:
npm run schema-canary:affecteddiffs against the base branch.jsonSchemaVersions.ts, a seed, a known-unsaved entry), it runs just those countries.example/src/flows/Onboarding/**, the basic-information version) runs every country.example/src/flows/Onboarding/**now triggers the PR canary:constants.tssetsfeaturesandjsfModify(including the customdaily_schedulecomponent), which change how contract details render.CI: the browser stage lives in a composite action,
.github/actions/schema-canary-browser, used by both jobs. It builds the library, installs Chromium, starts the example app against sandbox with the canary's secrets (same company as the seeded employments), runs the spec with 4 workers, and uploads the Playwright report. A browser failure on the nightly also opens or updates theschema-canaryissue.Look closely at: the step conditions in
schema-canary.yml(archiving must always run), and the PR job timeout (30 min).No public API changes.
Screenshots
N/A
Related Resources
Testing
Tested against the
example/app in a browser: DEU, ESP, FRA and GBR pass locally against sandbox.Feature flag: N/A
All 92 countries seed, submit and archive with
--keep-submittedlocally.Unit tests:
scripts/schema-canary/affected-countries.test.ts, updatedsubmit-contract-details.test.ts.schema-canary:affectedon a fake CHN bump plus a README edit returnsCHNonly.The full 92-country browser run is this PR's CI job.
🤖 Generated with Claude Code
Note
Medium Risk
Extends CI with sandbox-authenticated browser tests and changes headless submit/rebuild logic that the canary relies on; secrets only run in CI, not production app code.
Overview
Adds a browser stage to the contract-details schema canary: after Node seeds and submits against sandbox, successful employments are written via
--keep-submittedand Playwright walks the example onboarding flow to re-submit contract details, asserting thePATCHbody matches what the canary saved.CI gains a composite action (build, Chromium, start example app on sandbox, run
playwright.canary.config.ts, upload reports). Nightly and PR jobs run the browser step when kept employments exist, archive inalways(), and treat browser failures like canary failures for issues. PR runs useschema-canary:affectedto limit countries (or skip when none), add concurrency, and widen path triggers toexample/src/flows/Onboarding/**.Canary scripts: multi-country
--country, recordsenton successful submit, optional keep instead of immediate archive,schema-canary:archiveand affected-country detection with tests.submit-contract-detailsiterates rebuild passes so conditional defaults match the UI; seeding returnscompanyId; archive retries.Example app: token helpers are cached until expiry; regular Playwright ignores
**/canary/**.Reviewed by Cursor Bugbot for commit dd1981c. Bugbot is set up for automated code reviews on this repo. Configure here.